package com.epam.my.Kulibaba;

import org.junit.Before;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.testng.annotations.BeforeClass;

import com.epam.my.Pages.AnyPage;
import com.epam.my.Pages.LoginPage;
import com.epam.my.Pages.MyPageFactory;
import com.epam.my.WebDriverFactory.WebDriverFactory;

public class TestBase {
	protected WebDriver driver;
	protected String baseUrl;
	protected AnyPage mainPage;

	@BeforeClass
	public void setUp() throws Exception {
		driver = WebDriverFactory.getDriver(DesiredCapabilities.firefox());
		baseUrl = "http://www.rambler.ru";
	}

	public LoginPage goToMainPage() {
		driver.get(baseUrl + "/");
		mainPage = MyPageFactory.getPage(driver, AnyPage.class);
		 mainPage.toplineMenuMailLink.click();
		 return MyPageFactory.getPage(driver, LoginPage.class);
	}
}
